package com.kotodama.application.cqrs.commands;

import java.time.LocalDateTime;
import java.util.UUID;

/**
 * CQRS命令基类
 * 所有命令都应该继承此类
 */
public abstract class Command {

    private final String commandId;
    private final LocalDateTime timestamp;
    private final String tenantId;

    protected Command(String tenantId) {
        this.commandId = UUID.randomUUID().toString();
        this.timestamp = LocalDateTime.now();
        this.tenantId = tenantId;
    }

    public String getCommandId() {
        return commandId;
    }

    public LocalDateTime getTimestamp() {
        return timestamp;
    }

    public String getTenantId() {
        return tenantId;
    }
}